package ltd.newbee.mall.common;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public   static  String APP_ID = "2016102300747383";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public  static  String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCGFH0+/6/ROoCHeuzLadxdN4tKuLGX2WYKF2+S+PFF/YqYWxCn2iV4yqECjTxSNU5e3DXjZPlCa2qkfP+pQNNp6EUQAr5izL0jRK06i4Wju8cg6CYdazf5nIEgPSlmxBvOSUtlgW0/l0VVxi1e9F3iXs/msEfNHh2dStJU5AaF37vk/HSqjzI/0dsyOI7riXx0C83TOsR8FbXRvsKF/CRnu+yVLGo4B03EUIoS4NJrDMXfJ3al18lXDFqqyTzAfWTaJ2RpkT2EW3BiPs8R/DI5Wf452oaNP5VGEFmMVy0GPMeugFjdr4FhrqoA9cLN1UNEQxOJDTsiryZ6pk/tjO7DAgMBAAECggEAdPMyO90yMkHhEks6eEMiH3zvVoG7BkRuKKdAfuX9LZt1ZGcqI/63aKD1yBABaYNtlHhn2KyebjzbjBYruin9PgeHFewOvIbxAu5IWySPsL19d0qG1GpNLMBCMSioECdGSazMwwEdlbYQmDyAHq7vpSAmH4XrWxLFqgk1ZS5wMhwe+Sdt6Bk689VLOf8ukq6P5HYtaY4QuC/cTqnalfvebU2XcrkxsMD8/cYy6sV2l3xjBbOuik5KR6n8zrPDODIodLHsbAzJVNjWN8AHelzt2++aS28ZSrwvofbm//yk97dNfN1VK65bpBrP2Wp7ZX/L8oyxEs+3/Wm2l8y4szHkQQKBgQD6ey690NVjughAsy33vM4gDIrN9lepE1ZUcw+9l134zITPgDkYN9O4oZnf5I8P41klDYFclSEXoyHlEKB4B8zDyI5jGul+QNPpps+XQKnWmnQpSahDGmwOYG1+YD7DO/FqwUWc3qBkVdPi2hJBIdcTBaVxQUXf1D9ByZUQ6F+4uQKBgQCJCMGOJ0bTNg3SY5+FEFPq6NjbLW2RNx/8JeN7YERnkzU6tYp9SecsmUSSR7gFbqnRf4WWhLweiSM08yHmJeI6d1Eq4BapGP5Lz/0qxBmNuHQgKSwrb7h8LNku3lXDI/evKo1cENA0aYfSQdZ/bsla/kk1ukJx30boUkFFChvtWwKBgQDm2AYQ29j96uJWNoxDyFazhLub68+IPBERDWXRViI9/MbdsY9s+W5/tzdn9229t8pdcp/pImt4LFk9keBCHvYg7cIEJjZQrBBhQuIIxIiCBqDNuFuBVGWHrmja0nqlVaY9u9ebJjXtoof/hvjR3A0qM8bwpLZv/V07FTvzdCVbyQKBgHl7VLPj5+rISbqQ7NL25Z4j7FNp029gEi/jmuY+MoYrv42bcPmfMZydB2gywlW2hD+gMFp+s5LSem6veAbi4Mp6Cm/bFtuzt4SYD1UBYbH8qp30Qh8DvOYAkEz3d8o2MZaNP6I1mY5NW8Yu7awtF75eHaLOy6bNjLvaZ9h/nMBvAoGASqtpJzmFqRFYIu/REX6gd6HQPv+a1e8+SecZriRQrHte/HxYqj/Sp8SBx3FrgvKFARyHBfnLYjVqkc2IQg3KKirOhL8E9qnJL6rz618SmNhYhhxld22mM1r08KmrAKvExSX9AwqXdNmgSmbHRfVrmEWV74WXXpQu6b259Pd7b0s=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public  static  String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAj87sAieZL/RQDRBAPxQpLGKiLirZrK48AMyD2erbLaNif9BkvrppCduP+GmFZAFCBnXDWqJDwmQ9LYbVO3Uflq9OjDXLjtOGG3Gfzy3HLZq5LKEVY8wiYT8wtahgM38GlUOAHbeUAJiNz8KUetmc9MTCQR88rVZY3/rsb0lku+v2sm8sGkwS4PQvcYJb/fEqhK7NEwuOz8joJPYyTYFffDfdKuwVdXZQEtnqsxP26p4HlA2d3hQhqhdnE+hCK7cXDcnu1MZA7N4xkHNQikWY+PK3k8xz2C1jCcMpZbKrHOG+cnlXXdFKySwjm4lxkk7olMGd6DBZpog60+VklM9ofwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static  String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static  String RETURN_URL = "http://127.0.0.1:8080/alipayReturn";

    // 签名方式
    public static  String SIGN_TYPE = "RSA2";

    // 字符编码格式
    public static  String CHARSET = "utf-8";

    // 支付宝网关
    public static String GATEWAY_URL ="https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";
    public static String FORMAT = "json";
//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
